import Vue from 'vue'
import VueRouter from 'vue-router'
import RegisterPage from '@/views/Register.vue'
import MapPage from '@/views/map.vue'
import LayoutPage from '@/views/LayoutPage.vue'
import HomePage from '@/views/HomePage.vue'
import NewsPage from '@/views/NewsPage.vue'
import FindHouse from '@/views/FindHouse.vue'
import MyPage from '@/views/MyPage.vue'
import LoginPage from '@/views/login.vue'
Vue.use(VueRouter)

const routes = [
  { path: '/register', component: RegisterPage },
  { path: '/map', component: MapPage },
  { path: '/login', component: LoginPage },
  {
    path: '/',
    component: LayoutPage,
    children: [
      { path: '/home', component: HomePage },
      { path: '/news', component: NewsPage },
      { path: '/find', component: FindHouse },
      { path: '/my', component: MyPage }
    ]
  }

]

const router = new VueRouter({
  routes
})

export default router
